]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
loginDialog: Limit user list to the available height
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 10 Jul 2015 16:58:05 +0000 (18:58 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 3 Sep 2015 13:45:39 +0000 (15:45 +0200)
We currently will always allocate the user list's preferred size, so it
will grow indefinitely and never scroll; limit the height instead to
get the desired scrolling behavior when necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=754525

js/gdm/loginDialog.js

index c56651ba9324803aeb8e858de3ac23086f62f832..0e57536647e6a0b00eb5c5da7454d5d21e7e8bbc 100644 (file)
@@ -535,6 +535,9 @@ const LoginDialog = new Lang.Class({
         let centerX = dialogBox.x1 + (dialogBox.x2 - dialogBox.x1) / 2;
         let centerY = dialogBox.y1 + (dialogBox.y2 - dialogBox.y1) / 2;
 
+        natWidth = Math.min(natWidth, dialogBox.x2 - dialogBox.x1);
+        natHeight = Math.min(natHeight, dialogBox.y2 - dialogBox.y1);
+
         actorBox.x1 = Math.floor(centerX - natWidth / 2);
         actorBox.y1 = Math.floor(centerY - natHeight / 2);
         actorBox.x2 = actorBox.x1 + natWidth;